<html manifest="IGNORE.manifest" lang="zh-CN" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"><!DOCTYPE html>
<html manifest="IGNORE.manifest" lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css" th:href="@{${uiPath} + ${appName} + '/css/reset.css'}"/>
    <link rel="stylesheet" type="text/css" href="../css/cl.css" th:href="@{${uiPath} + ${appName} + '/css/cl.css'}"/>
</head>
<body>
<div class="zong">
        <input type="button" th:value="确认支付" onclick="onBridgeReady()">
</div>
<script type="text/javascript" src="../js/flexible.js" th:src="@{${uiPath} + ${appName} + '/js/flexible.js'}"></script>
<script type="text/javascript" src="../js/jquery.min.js" th:src="@{${uiPath} + ${appName} + '/js/jquery.min.js'}"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" th:src="'http://res.wx.qq.com/open/js/jweixin-1.2.0.js'"></script>
<!--
<script type="text/javascript" src="../js/share.js" th:src="@{${uiPath} + ${appName} + '/js/share.js'}"></script>
-->

<script type="text/javascript" src="../js/cl.js" th:src="@{${uiPath} + ${appName} + '/js/cl.js'}"></script>
<script th:inline="javaScript">
    function onBridgeReady(){

        WeixinJSBridge.invoke(
            'getBrandWCPayRequest', {
                "appId":[[${data.appId}]],     //公众号名称，由商户传入
                "timeStamp":[[${data.timeStamp}]],         //时间戳，自1970年以来的秒数
                "nonceStr":[[${data.nonceStr}]], //随机串
                "package":[[${data.package}]] ,
                "signType":[[${data.signType}]],         //微信签名方式：
                "paySign": [[${data.paySign}]]//微信签名
            },
            function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok" ) {
                    alert("支付成功");

                }     // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回    ok，但并不保证它绝对可靠。
            }
        );
    }

    if (typeof WeixinJSBridge == "undefined"){
        if( document.addEventListener ){
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        }else if (document.attachEvent){
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    }else{
        onBridgeReady();
    }



</script>
</body>
</html>